﻿using UnityEngine;
using System.Collections;

public class Hero : MonoBehaviour {

    public float speed = 1;

    private NetworkView netView;

	// Use this for initialization
	void Start () {
        netView = GetComponent<NetworkView>();
	}
	
	// Update is called once per frame
	void Update () {
	
	}

    void FixedUpdate()
    {
        if (netView.isMine)
        {

            float x = Input.GetAxis("Horizontal");
            float y = Input.GetAxis("Vertical");

            Vector3 pos = transform.position;
            pos.x += x * speed * Time.deltaTime;
            pos.y += y * speed * Time.deltaTime;

            transform.position = pos;

        }
    }
}
